package com.multicampus.simplewiki.control;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import com.multicampus.simplewiki.ctrl.DocumentManager;

public class UpdateViewPageController implements Controller {
	private DocumentManager documentManager;

	public void setDocumentManager(DocumentManager documentManager) {
		this.documentManager = documentManager;
	}

	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		return new ModelAndView("/wikipage/updateView_page", "document",
				documentManager.findDocument(Integer.parseInt(request
						.getParameter("id"))));

	}
}